home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 015a / fdate41a.zip / HOLIDAYS.BAT < prev   
DOS Batch File  |  1992-01-03  |  6KB  |  130 lines

  1. @echo off
  2. CLS
  3. REM If you have any corrections to the algorithms
  4. REM in this batch file, please send them to Steve Ferg.
  5.  
  6. if not (%1)==() goto nohelp
  7. echo ───────────────────────────────────────────────────────────────────────────────
  8. echo                   HOW TO USE HOLIDAYS.BAT
  9. echo ───────────────────────────────────────────────────────────────────────────────
  10. ECHO HOLIDAYS without any parameters displays events in current year.
  11. ECHO.
  12. ECHO HOLIDAYS [year]                 displays events in [year].
  13. ECHO EXAMPLE: HOLIDAYS 1999          displays events in year 1999.
  14. ECHO.
  15. pause
  16. cls
  17. :nohelp
  18.  
  19. Fdate /Ff /At /Occyy /P"@set year=" >junktemp.bat
  20. if errorlevel 1 echo FDATE ENCOUNTERED AN ERROR
  21. if errorlevel 1 goto endit
  22. call junktemp.bat
  23. del  junktemp.bat
  24.  
  25. REM if user specifies a year as parm1, use it
  26. if not (%1)==() set year=%1
  27.  
  28. rem --------------------------------------------------------
  29. rem determine if year is a leapyear
  30. rem AND ALSO check for validity of year
  31. rem --------------------------------------------------------
  32. Fdate /Ff /Imm-dd-ccyy /A01-01-%year% /Oly /P"@set LY=">junktemp.bat
  33. if errorlevel 1 echo Parm 1 was not a valid year: %1
  34. call junktemp.bat
  35. del  junktemp.bat
  36. if errorlevel 1 goto endit
  37. echo ───────────────────────────────────────────────────────────────────────────────
  38. ECHO                   EVENTS IN THE FIRST HALF OF %YEAR%
  39. echo ───────────────────────────────────────────────────────────────────────────────
  40. Fdate /Ff /Imm-dd-ccyy /Od1 /a01-01-%year% /P"New Year's Day........................"
  41. Fdate /Fw /D2 /N3 /A01-01-%year% /Imm-dd-ccyy /Od1 /P"Martin Luther King, Jr. Day..........."
  42. Fdate /Ff /Imm-dd-ccyy /Od1 /a02-14-%year% /P"Valentine's day......................."
  43. Fdate /Ff /Imm-dd-ccyy /Od1 /a03-17-%year% /P"St. Patricks's Day...................."
  44.  
  45. if (%LY%)==(1) Fdate /Ff /Imm-dd-ccyy /Od1 /a02-29-%year% /P"Sadie Hawkins Day....................."
  46. set ly=
  47. set easter=
  48. if (%year%)==(1992) set easter=04-19-%year%
  49. if (%year%)==(1993) set easter=04-11-%year%
  50. if (%year%)==(1994) set easter=04-03-%year%
  51. if (%year%)==(1995) set easter=04-16-%year%
  52. if (%year%)==(1996) set easter=04-07-%year%
  53. if (%year%)==(1997) set easter=03-30-%year%
  54. if (%year%)==(1998) set easter=04-12-%year%
  55. if (%year%)==(1999) set easter=04-04-%year%
  56. if (%year%)==(2000) set easter=04-23-%year%
  57. if (%easter%)==() goto unknown
  58. Fdate /Fsub /Imm-dd-ccyy /N40 /Od1 /a%easter% /P"Mardi Gras (Shrove Tuesday)..........."
  59. Fdate /Fsub /Imm-dd-ccyy /N39 /Od1 /a%easter% /P"Ash Wednesday (Lent begins)..........."
  60. Fdate /Fsub /Imm-dd-ccyy /N7  /Od1 /a%easter% /P"Palm Sunday..........................."
  61. Fdate /Ff   /Imm-dd-ccyy      /Od1 /a%easter% /P"Easter................................"
  62. set easter=
  63. :unknown
  64.  
  65. Fdate /Fw /D4 /N4 /A04-01-%year% /Imm-dd-ccyy /Od1 /P"Secretaries Day......................."
  66. Fdate /Ff /Imm-dd-ccyy /Od1 /a05-05-%year% /P"Cinco de Mayo (Mexico)................"
  67.  
  68. Fdate /Fw /D1 /N2 /A05-01-%year% /Imm-dd-ccyy /Od1 /P"Mother's Day.........................."
  69. Fdate /Fw /D2 /N-1 /A05-24-%year% /Imm-dd-ccyy /Od1 /P"Victoria Day (Canada)................."
  70. Fdate /Ff /Imm-dd-ccyy /Od1 /a05-30-%year% /P"Memorial Day.........................."
  71.  
  72. echo ───────────────────────────────────────────────────────────────────────────────
  73. echo.
  74. PAUSE
  75. CLS
  76. echo ───────────────────────────────────────────────────────────────────────────────
  77. ECHO                   EVENTS IN THE SECOND HALF OF %YEAR%
  78. echo ───────────────────────────────────────────────────────────────────────────────
  79.  
  80. rem ------------ begin bloom's day --------------------------------------
  81. rem Here's another way to show an anniversary that you want to note.
  82. rem Set SD (special date) to the ORIGINAL date of an event whose
  83. rem anniversary you want to note.
  84. rem --------------------------------------------------------
  85. rem June 16, 1904: Bloom's day
  86. SET SD=06-16-1904
  87.  
  88. Fdate /Ff /Imm-dd-ccyy /A%SD% /Occyy /P"@set SDccyy=">junktemp.bat
  89. call junktemp.bat
  90. del  junktemp.bat
  91. Fdate /Ff /Imm-dd-ccyy /A%SD% /Ommdd /P"@set SDmmdd=">junktemp.bat
  92. call junktemp.bat
  93. del  junktemp.bat
  94. rem find difference of years
  95. Fdate /F#dif /A%SDccyy% /B%year%   /P"@set SD#=">junktemp.bat
  96. call junktemp.bat
  97. del  junktemp.bat
  98. Fdate /Ff /Iccyymmdd /A%year%%SDmmdd% /Od1 /P"%SD#%th anniversary of Bloom's day......."
  99. set SD=
  100. set SD#=
  101. set SDmmdd=
  102. set SDccyy=
  103. rem ---------------end bloom's day --------------------------------------
  104.  
  105. Fdate /Ff /Imm-dd-ccyy /Od1 /a07-01-%year% /P"Canada Day (Canada)..................."
  106. Fdate /Ff /Imm-dd-ccyy /Od1 /a07-04-%year% /P"4th of July..........................."
  107. Fdate /Ff /Imm-dd-ccyy /Od1 /a07-14-%year% /P"Bastille Day (France)................."
  108.  
  109. Fdate /Fw /D2 /N2 /A10-01-%year% /Imm-dd-ccyy /Od1 /P"Columbus Day (observed)..............."
  110. Fdate /Ff /Imm-dd-ccyy /Od1 /a11-11-%year% /P"Veteran's Day........................."
  111.  
  112. Fdate /Fw /D5 /N4 /A11-01-%year% /Imm-dd-ccyy /Od1 /P"Thanksgiving Day......................"
  113.  
  114. rem ----------- begin: Pearl Harbor day -----------------------------
  115. rem Show an anniversary number. (Thanks to L. Schliesser for example)
  116. rem -----------------------------------------------------------------
  117. Fdate /F#dif /A%year% /B1941 /P"@set ann=">junktemp.bat
  118. call junktemp.bat
  119. del junktemp.bat
  120. Fdate /Ff /Imm-dd-ccyy /a12-07-%year% /Od1 /P"Pearl Harbor Day (%ann%th anniversary)..."
  121. rem -----------   end: Pearl Harbor day -----------------------------
  122.  
  123. Fdate /Ff /Imm-dd-ccyy /Od1 /a12-25-%year% /P"Christmas............................."
  124. Fdate /fadd /Imm-dd-ccyy /Od1 /N1 /a12-31-%year% /P"New Year's Day........................"
  125. echo ───────────────────────────────────────────────────────────────────────────────
  126. echo.
  127. :endit
  128. set year=
  129. set LY=
  130.